import { Component, OnInit } from '@angular/core';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { Router } from '@angular/router';

@Component({
  selector: 'app-extract-tag',
  templateUrl: './extract-tag.component.html',
  styleUrls: ['./extract-tag.component.scss']
})
export class ExtractTagComponent implements OnInit {
  listOfData: any = [];
  selectedListL:any[] = [];
  confirmModal?: NzModalRef;

  constructor(private modal: NzModalService,private router:Router) { }

  ngOnInit() {
    this.listOfData = new Array(100).fill(0).map((_, index) => {
      return {
        id: index,
        url: `../../../../../assets/images/bgd.jpeg`
      };
    });
  }

  return(){
    history.go(-1);
  }

  imgClick(id:string){
    if(this.selectedListL.indexOf(id) != -1){
      this.selectedListL.splice(this.selectedListL.indexOf(id),1);
    }else{
      this.selectedListL.push(id);
    }
  }

  addImg(){

  }

  deleteImg(){
    this.confirmModal = this.modal.confirm({
      nzTitle: '是否确认删除?',
      nzContent: '删除后无法恢复，请确认是否删除！',
      nzOnOk: () =>{

      }
    });
  }

  batImg(){
    this.router.navigate(['/extract/extractTagEdit']);
  }

  returnExtractDataset(){
    this.router.navigate(['/extract/extractDataset']);
  }
}
